import React from 'react'
// ===================================================================== Temp
import FormModal from '#cpt/temp/FormModal'
// ===================================================================== component
class Index extends React.Component{
	state = {
		// 提交表单列表
		formData : [
			{ label: '原因', name: 'remark', full:true, type:'textarea' }
		]
	}
	
	model = {}
	submit = {}
	
	open = (title, { query, selectedKeys, selectedRows }) => {
		this.modal.open({ formRef:this.formRef })
		const spec_codes = selectedRows.map(v => v.spec_code)		 // 不通过添加spac_codes、commit_type参数 2021-9-9 11:15:39 ?F10: AM?  --马婷 
		this.submit = {...query, ids: selectedKeys, type:-1, spec_codes, commit_type:this.props.rowsType}
		this.setState({title})
	}
	
	render(){
		const { title } = this.state
		let api = 'ts-report-card/upaudit'
		
		if(title === '不通过'){
			const { isBingLiMode } = this.props
			api = isBingLiMode ? api : 'ts-report-card/upsub'
		}
		
		return FormModal.call(this,{ title, labelWidth:'s3', width:600, api }) 
	}
}

export default Index